<extend name="Base/common" />
<block name="body">
  <div class="span9 page_message">
    <section id="contents">
      <ul class="tab-nav nav">
        <li class=""><a href="{:U('lists')}">红包列表<b class="arrow fa fa-sort"></b></a></li>
        <li class="current"><a href="javascript:;">编辑红包<b class="arrow fa fa-sort"></b></a></li>
      </ul>
      <div class="tab-content"> 
        <!-- 表单 -->
        <php> $post_url || $post_url = U('edit?model='.$model['id'], $get_param);</php>
        <form id="form" action="{$post_url}" method="post" class="form-horizontal form-center">
        	<ul id="tab" class="tab-pane in">
<!--             	 <li class="form-item cf"> -->
<!--                     <label class="item-label"><span class="need_flag">*</span>商户号<span class="check-tips">（微信支付分配的商户号）</span></label> -->
<!--                     <div class="controls"> -->
<!--                       <input type="text" class="text input-large" name="mch_id" value="{$data.mch_id}"> -->
<!--                     </div> -->
<!--                   </li>  -->
<!--                   <li class="form-item cf"> -->
<!--                     <label class="item-label"><span class="need_flag">*</span> 公众账号appid <span class="check-tips">（商户appid）</span></label> -->
<!--                     <div class="controls"> -->
<!--                       <input type="text" class="text input-large" name="wxappid" value="{$data.wxappid}"> -->
<!--                     </div> -->
<!--                   </li>   -->
                  <li class="form-item cf">
                    <label class="item-label"><span class="need_flag">*</span> 提供方名称 <span class="check-tips"></span></label>
                    <div class="controls">
                      <input type="text" class="text input-large" name="nick_name" value="{$data.nick_name}">
                    </div>
                  </li>  
                   <li class="form-item cf">
                    <label class="item-label"><span class="need_flag">*</span> 商户名称  <span class="check-tips">（红包发送者名称）</span></label>
                    <div class="controls">
                      <input type="text" class="text input-large" name="send_name" value="{$data.send_name}">
                    </div>
                  </li>  
                   <li class="form-item cf">
                    <label class="item-label"><span class="need_flag">*</span> 付款金额   <span class="check-tips">（付款金额，单位分）</span></label>
                    <div class="controls">
                      <input type="number" class="text input-large" name="total_amount" value="{$data.total_amount}">
                    </div>
                  </li>  
                   <li class="form-item cf">
                    <label class="item-label"><span class="need_flag">*</span>  最小红包金额     <span class="check-tips">（付款金额，单位分）</span></label>
                    <div class="controls">
                      <input type="number" class="text input-large" name="min_value" value="{$data.min_value}">
                    </div>
                  </li>  
                   <li class="form-item cf">
                    <label class="item-label"><span class="need_flag">*</span>  最大红包金额     <span class="check-tips">（付款金额，单位分）</span></label>
                    <div class="controls">
                      <input type="number" class="text input-large" name="max_value" value="{$data.max_value}">
                    </div>
                  </li>  
                  <li class="form-item cf">
                    <label class="item-label"><span class="need_flag">*</span>  红包发放总人数     <span class="check-tips"></span></label>
                    <div class="controls">
                      <input type="number" class="text input-large" name="total_num" value="{$data.total_num}">
                    </div>
                  </li>  
                  <li class="form-item cf">
                    <label class="item-label"><span class="need_flag">*</span>  红包祝福语      <span class="check-tips">（如：感谢您参加猜灯谜活动，祝您元宵节快乐！）(不超过25个字)</span></label>
                    <div class="controls">
                      <input type="text" class="text input-large" name="wishing" value="{$data.wishing}">
                    </div>
                  </li>  
                 
                  <li class="form-item cf">
                    <label class="item-label"><span class="need_flag">*</span>活动名称 <span class="check-tips">（如：猜灯谜抢红包活动）(不超过25个字)</span></label>
                    <div class="controls">
                      <label class="textarea input-large">
                      <textarea class="text input-large" name="act_name" >{$data.act_name}</textarea>
                      </label>
                    </div>
                  </li>   
                   <li class="form-item cf">
                    <label class="item-label"><span class="need_flag">*</span>  每人最多领取次数       <span class="check-tips">（0 表示不限制）</span></label>
                    <div class="controls">
                      <input type="number" class="text input-large" name="collect_limit" value="{$data.collect_limit}">
                    </div>
                  </li> 
<!--                    <li class="form-item cf"> -->
<!--                     <label class="item-label"><span class="need_flag">*</span>  商户API密钥        <span class="check-tips">（用户生成支付签名）</span></label> -->
<!--                     <div class="controls"> -->
<!--                       <input type="text" class="text input-large" name="partner_key" value="{$data.partner_key}"> -->
<!--                     </div> -->
<!--                   </li>   -->
                   <li class="form-item cf">
                    <label class="item-label"><span class="need_flag"></span> 活动备注      <span class="check-tips"></span></label>
                    <div class="controls">
                      <input type="text" class="text input-large" name="act_remark" value="{$data.act_remark}">
                    </div>
                  </li>  
                  <!-- 选择模板 -->
<!--                  <li class="form-item"> -->
<!--                     <label class="item-label"> -->
<!--                            模板选择 -->
<!--                     </label> -->
<!--                     <div class="controls"> -->
<!--                         <select id="template" name="template" data-url="{:U('addons/get_package_template?addons=RedBag')}"> -->
<!--                             <option value="{$data.template}">{:get_sucai_template_info($data[template],'RedBag')[title]}</option> -->
<!--                         </select> -->
<!--                     </div> -->
<!--                  </li> -->
                  
            </ul>
          	<div class="form-item form_bh">
            	<notempty name="data.id"><input type="hidden" name="id" value="{$data.id}"></notempty>
            	<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定</button>
            </div>
        </form>
      </div>
    </section>
  </div>
</block>
<block name="script">
  <link href="__STATIC__/datetimepicker/css/datetimepicker.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
  <php>if(C('COLOR_STYLE')=='blue_color') echo '
    <link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
    ';</php>
  <link href="__STATIC__/datetimepicker/css/dropdown.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
  <script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.js"></script> 
  <script type="text/javascript" src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js?v={:SITE_VERSION}" charset="UTF-8"></script> 
<script type="text/javascript">
$(function(){
	 initUploadImg();
	 })
$('#submit').click(function(){
    $('#form').submit();
});

$(function(){
    $('.time').datetimepicker({
        format: 'yyyy-mm-dd hh:ii',
        language:"zh-CN",
        minView:0,
        autoclose:true
    });
    $('.date').datetimepicker({
        format: 'yyyy-mm-dd',
        language:"zh-CN",
        minView:2,
        autoclose:true
    });	
    showTab();
	
	$('.toggle-data').each(function(){
		var data = $(this).attr('toggle-data');
		if(data=='') return true;		
		
	     if($(this).is(":selected") || $(this).is(":checked")){
			 change_event(this)
		 }
	});
	
	$('.toggle-data').bind("click",function(){ change_event(this) });
});
</script> 
</block>
